<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!-- 검색 결과 리스트를 보여주는 table -->
<h3>검색 결과</h3>
	<table class="list_table" border="1" width="600" cellpadding="2">
		<tr>
			<th width="10%">번호</th>
			<th width="45%">제목</th>
			<th width="15%">작성자</th>
			<th width="15%">작성일</th>
			<th width="15%">조회수</th>
		</tr>
		<c:forEach var="bvo" items="${requestScope.lvo.list}">
			<tr>
				<td>${bvo.no }</td>
				<td><c:if test = "${bvo.relevel > 0}">
				<c:forEach begin = "1" end = "${bvo.relevel}">　</c:forEach>[답글]</c:if>
				<a href="showContentHits.inven?no=${bvo.no }">${bvo.title }</a></td>
				<td>${bvo.id }</td>
				<td>${bvo.timePosted }</td>
				<td>${bvo.hits }</td>
			</tr> 
		</c:forEach>
	</table>
	
<%------------------------------------------- 페이징 -------------------------------------------%>
	<%-- 이전 페이지 그룹이 있을 경우  --%>
	<c:if test="${requestScope.lvo.pagingBean.previousPageGroup}">
		<a href="searchByKeyword.inven?pageNo=${requestScope.lvo.pagingBean.startPageOfPageGroup-1}&keyword=${param.keyword}&keywordType=${param.keywordType}">◀</a>
	</c:if>
	<%-- 페이징 부분 --%>
	<c:forEach var="i" begin="${requestScope.lvo.pagingBean.startPageOfPageGroup}"
		end="${requestScope.lvo.pagingBean.endPageOfPageGroup}">
		<c:choose>
			<c:when test="${requestScope.lvo.pagingBean.nowPage!=i}">
				<a href="searchByKeyword.inven?pageNo=${i}&keyword=${param.keyword}&keywordType=${param.keywordType}">${i}</a>
			</c:when>
			<c:otherwise>
				${i} 
			</c:otherwise>
		</c:choose>
	</c:forEach>
	<%-- 다음 페이지 그룹이 있을 경우 --%>
	<c:if test="${requestScope.lvo.pagingBean.nextPageGroup}">
		<a href="searchByKeyword.inven?pageNo=${requestScope.lvo.pagingBean.endPageOfPageGroup+1}&keyword=${param.keyword}&keywordType=${param.keywordType}">▶</a>
	</c:if>
